
	$(document).ready(function() {
		selectDataList("");
	});

function selectDataList(time) {
		$("#thislist").html("");
		$.ajax({
			url: urlcore + "/api/dataReport/payMoneyAuditStatement?time="+time,
			type: "get",
			dataType: 'json',
			async:'false',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
        	if(data.success == true) {
        		$.each(data.data, function(i,n) {
					var thislist=
					'<tr class="footable-even" style="display: table-row;">' +
					'<td class="footable-visible">' + (i+1) + '</td>' +
					'<td class="footable-visible">' + n.name + '</td>' +
					'<td class="footable-visible">' + n.loginName + '</td>' +
					'<td class="footable-visible">' + n.totalNum + '</td>' +
					'<td class="footable-visible">' + n.passNum  + '</td>' +
					'<td class="footable-visible">' + n.refuseNum + '</td>' +
					'<td class="footable-visible">' + n.notOperatedNum + '</td>' ;
					$('#thislist').append(thislist);
				});
			}else if (data.code == 'OVERTIME'){
				var thisUrl = window.location.href;
				if (thisUrl.indexOf('login.html') <= -1) {
					top.window.location.href="login.html";
				}
			}else if (data.code == 'FAIL'){
				alert(data.msg);
			}

			},
			error: function() {
				alert("服务器异常");
			}
		});
	}

	/*function selectDataList(time) {
		$("#thislist").html("");
		$.ajax({
			url: urlcore + "/api/dataReport/payMoneyAuditStatement?time="+time,
			type: "get",
			dataType: 'json',
			async:'false',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
        	if(data.success == true) {
        		$.each(data.data, function(i,n) {
					var number = n.number;
					var numberNo = n.numberNo;
					if (number == null) {
						number =0;
					}
					if (numberNo == null) {
						numberNo =0;
					}
					var thislist=
					'<tr class="footable-even" style="display: table-row;">' +
					'<td class="footable-visible">' + (i+1) + '</td>' +
					'<td class="footable-visible">' + n.adminName + '</td>' +
					'<td class="footable-visible">' + n.adminLoginName + '</td>' +
					'<td class="footable-visible">' + number + '</td>' +
					'<td class="footable-visible">' + (number-numberNo)  + '</td>' +
					'<td class="footable-visible">' + numberNo + '</td>' ;
					$('#thislist').append(thislist);
				});
			}else if (data.code == 'OVERTIME'){
				var thisUrl = window.location.href;
				if (thisUrl.indexOf('login.html') <= -1) {
					top.window.location.href="login.html";
				}
			}else if (data.code == 'FAIL'){
				alert(data.msg);
			}

			},
			error: function() {
				alert("服务器异常");
			}
		});
	}*/
	



/**
 * 搜索
 */
function searchList(){
	var time=$('#applyTime').val();
	selectDataList(time);
}


//导出表格
function excal() {
	
	time=$('#applyTime').val().trim();
	
	$.ajax({
		url: urlcore + "/api/dataReport/makeExcle?day=" + time,
		type: "GET",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success: function(data) {
			if(data.success == true) {
				var url1 =  data.data.toString().slice(4);
				location.href="https"+url1;
			} else {
				alert(data.msg);
			}
		},
		error: function() {
			alert("error");
		}
	});
}
